﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using FileDB;
namespace Rem.Objects.Forms
{
    public class FormHelper
    {

        public static Form OpenObjectForm(BaseObjectTypes baseType, object data)
        {
            Form f = null;
            switch (baseType)
            {
                case BaseObjectTypes.EmployeeQuery:
                    f = new EmployeeForm(data as Employee);
                    break;
                case BaseObjectTypes.ContractQuery:
                    f = new ContractForm(data as Contract);
                    break;
                case BaseObjectTypes.CustomerQuery:
                    f = new CustomerForm(data as Customer);
                    break;
                case BaseObjectTypes.ReminderQuery:
                    f = new ReminderForm2(data as Reminder);
                    break;
                default:
                    break;
            }
            
            f.Show();
            f.Focus();
            f.Activate();
            //f.MaximizeBox = true;
           f.Dock = DockStyle.Fill;
            return f;
        }

        public static Form OpenObjectForm(BaseObjectTypes baseType, object objectID, bool cloneObject)
        {
            Form f = null;
            switch (baseType)
            {
                case BaseObjectTypes.Employee:
                    f = new EmployeeForm();
                    break;
                case BaseObjectTypes.EmployeeQuery:
                    f = new QueryForm(BaseObjectTypes.EmployeeQuery, "员工查询");
                    break;
                case BaseObjectTypes.Contract:
                    f = new ContractForm();
                    break;
                case BaseObjectTypes.ContractQuery:
                    f = new QueryForm(BaseObjectTypes.ContractQuery, "合同查询");
                    break;
                case BaseObjectTypes.Customer:
                    f = new CustomerForm();
                    break;
                case BaseObjectTypes.CustomerQuery:
                    f = new QueryForm(BaseObjectTypes.CustomerQuery, "客户查询");
                    break;
                case BaseObjectTypes.Reminder:
                    f = new ReminderForm2();
                    break;

                case BaseObjectTypes.ReminderQuery:
                    f = new QueryForm(BaseObjectTypes.ReminderQuery, "提醒查询");
                    break;
                case BaseObjectTypes.Incoming:
                    break;
                case BaseObjectTypes.Outcoming:
                    break;
                case BaseObjectTypes.StartInfo:
                    break;
                case BaseObjectTypes.Queries:
                    break;
                case BaseObjectTypes.QueryClauses:
                    break;
                default:
                    break;
            }

            f.Dock = DockStyle.Fill;
            f.Show();
            f.Focus();
            f.Activate();
            return f;
        }
    }
}
